package com.hundsun.cprs.yyt.web.vo.excel;

import java.util.Date;

import com.hundsun.cprs.yyt.service.dilivery.enums.EnumDiliveryType;
import com.hundsun.cprs.yyt.service.order.dto.OrderInfo;
import com.hundsun.cprs.yyt.service.order.enums.EnumsOrderStatus;
import com.hundsun.cprs.yyt.util.MoneyUtils;

/**
 * 导出的订单信息数据
 * @author linrl
 * @date 2019年4月8日
 */
public class OrderInfoVo {
    /**
     * 订单编号
     */
    private String sn;
    /**
     * 商品名称
     */
    private String goodsName;
    /**
     * 商品编号
     * */
    private String goodsCode;
    /**
     * 订单总金额
     */
    private String price;
    /**
     * 买家交易账号
     */
    private String fundAccount;
    /**
     * 买家姓名
     */
    private String userName;
    /**
     * 订单状态
     */
    private String status;
    
    /**
     * 下单时间
     */
    private Date orderDate;

    /**
     * 支付时间
     */
    private Date payDate;
    
    private String deliveryTypeDesc;
    
    private Integer shippedQuantity;
    
    private String consignee;
    
    private String phone; 

    private String address;

    public OrderInfoVo(OrderInfo order){
        this.sn = order.getSn();
        this.goodsName = order.getOrderItems().get(0).getGoodsName();
        this.goodsCode = order.getOrderItems().get(0).getGoodsCode();
        this.price = MoneyUtils.getMoneyFormatFen(order.getPrice());
        this.fundAccount = order.getFundAccount();
        this.userName = order.getUserName();
        this.status = EnumsOrderStatus.indexByValue(order.getStatus()).getDesc();
        this.orderDate = order.getOrderDate();
        this.payDate = order.getPayDate();
        this.deliveryTypeDesc = EnumDiliveryType.indexByValue(order.getDeliveryType().toString()).getDescription();
        this.shippedQuantity = order.getOrderItems().get(0).getQuantity() - order.getOrderItems().get(0).getShippedQuantity().intValue();
        this.consignee = order.getConsignee();
        this.phone = order.getPhone();
        this.address = order.getAddress();
    }
    
    public String getSn() {
        return sn;
    }
    public void setSn(String sn) {
        this.sn = sn;
    }
    public String getGoodsName() {
        return goodsName;
    }
    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }
    public String getFundAccount() {
        return fundAccount;
    }
    public void setFundAccount(String fundAccount) {
        this.fundAccount = fundAccount;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public String getDeliveryTypeDesc() {
        return deliveryTypeDesc;
    }

    public void setDeliveryTypeDesc(String deliveryTypeDesc) {
        this.deliveryTypeDesc = deliveryTypeDesc;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getShippedQuantity() {
        return shippedQuantity;
    }

    public void setShippedQuantity(Integer shippedQuantity) {
        this.shippedQuantity = shippedQuantity;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }
}
